package cn.imokay.springboot.yml.configmodel;

import lombok.Data;
import org.hibernate.validator.constraints.Email;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

@Data
//@ConfigurationProperties("")
@Component
@Validated
public class ValuePropertiesModel {

    //不支持松散绑定,只支持简单数据,不支持复杂数据
    //支持驼峰==>横线,反过来不支持
    //不支持元数据,用于智能提示
    @Value("${myconfig.str}")
    private String str;
    @Value("${myconfig.specialstr}")
    private String specialstr;
    @Value("${myconfig.intnum}")
    private Integer intnum;
    @Value("#{12*3}")
    private Integer spelNum;


    //不支持校验
    @Email
    @Value("${myconfig.email2}")
    private String e;
}
